package com.quxiu.common.core.domain;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 通用节点对象
 */
@Data
public class Node implements Serializable {
    private static final long serialVersionUID = 1L;

    private String id;
    private String label;
    private String parentId;
    private Type type;
    private List<Node> children;

    /**
     * 节点类型
     */
    public enum Type {
        // 用户
        user,
        // 部门
        dept,
        // 角色
        role
    }

    public String getNodeKey() {
        return this.type + "-" + this.id;
    }
}
